<?php

use Phinx\Migration\AbstractMigration;

class ModifyColumnStatusTypeToVarcharInOrderTable extends AbstractMigration
{

    public function up()
    {
        $this->table("order")->changeColumn("status", 'string', [
            'limit' => 60,
            'null' => false,
            'comment' => "订单状态",
            'default' => 'wait_for_party_a_review',
        ])->save();
    }

    public function down()
    {
        $this->table("order")
            ->changeColumn('status', 'enum', [
                'values' => 'wait_for_party_a_review,party_a_review_deny,wait_for_party_b_ensure,party_b_deny,wait_for_sign,cancel,inprogress,done',
                'default' => 'wait_for_party_a_review',
                'comment' => '订单状态 wait_for_party_a_review：等待甲方审核、party_a_review_deny:甲方审核拒绝, wait_for_party_b_ensure:等待乙方确认,party_b_deny:乙方拒绝,wait_for_sign:等待签名, cancel：取消、 inprogress：进行中，done：完成'
            ])
            ->save();
    }
}
